//
//  ESTActivityChartsModel.m
//  ESTSCRMAPP
//
//  Created by 李贤立 on 2018/10/17.
//  Copyright © 2018年 Capfer. All rights reserved.
//

#import "ESTActivityChartsModel.h"

@implementation ESTActivityChartsModel

/**
 请求排序数据

 @param activityID 活动ID
 @param bus_type 排序类型
 @param orderby 排序字段
 @param success 成功回调
 @param failure 失败回调
 */
+ (void)requestActivityChartsDataWithActivityID:(NSString *)activityID bus_type:(NSInteger)bus_type orderby:(NSInteger)orderby success:(void(^)(NSArray<ESTActivityChartsModel *> *modelArray))success failure:(void(^)(NSString *error))failure {
    NSDictionary *dict = @{
                           @"BUS_TYPE" : @(bus_type),
                           @"ACTIVITY_ID" : activityID,
                           @"ORDERBY" : @(orderby)
                           };
    [NetTool postWithCode:Code_Activity_Charts parameter:dict success:^(NSDictionary *result) {
        NSArray *arr = [NSArray arrayWithArray:result[@"DATA_INFO"]];
        NSMutableArray *arrayM = [ESTActivityChartsModel mj_objectArrayWithKeyValuesArray:arr];
        if (success) {
            success([arrayM mutableCopy]);
        }
    } failure:^(NSString *error) {
        if (failure) {
            failure(error);
        }
    }];
}
@end
